package com.combetter.changxing.bindingconfig;

import android.databinding.BindingAdapter;
import android.graphics.drawable.Drawable;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;

/**
 * Created by Mark.fan on 2018/5/28.
 */

public class ToolBarConfig {

    @BindingAdapter(value = {"menu", "title", "overflowIcon"}, requireAll = false)
    public static void infalteMenu(Toolbar toolbar, int menu, String title,  Drawable overflowIcon) {
        toolbar.inflateMenu(menu);
        toolbar.setTitle(title);
//        toolbar.setNavigationIcon(ContextCompat.getDrawable(toolbar.getContext(), navigationIcon));
        toolbar.setOverflowIcon(overflowIcon);
    }

    @BindingAdapter(value = {"onMenuItemClickListener", "navigationOnClickListener"}, requireAll = false)
    public static void setListener(Toolbar toolbar, Toolbar.OnMenuItemClickListener onMenuItemClickListener, ActionBar.OnNavigationListener onNavigationListener) {

    }
}
